package io.iamting93.code.feign;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author boting.guo
 * @date 2021/11/30 15:26
 */

@Slf4j
@Component
public class EmailFeignFallbackFactory implements FallbackFactory<EmailFeign> {

    @Override
    public EmailFeign create(Throwable throwable) {
        log.error(throwable.getMessage(), throwable);
        return (emailAddress, content) -> false;
    }
}
